package com.ibl.rover.lite.service;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

import com.ibl.rover.lite.service.utill.HibernateUtill;

 
public class RoverListner implements ServletContextListener {

	private Configuration config;
	private SessionFactory sessionFactory;
	private String path = "/hibernate.cfg.xml";
	
	@Override
	public void contextDestroyed(ServletContextEvent arg0) {
		
		HibernateUtill.getSessionFactory().close();
	}

	@Override
	public void contextInitialized(ServletContextEvent arg0) {
		HibernateUtill.getSessionFactory().openSession();
	}

}
